using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Dimok.Data.Database;
using Dimok.Data;
using Dimok.Exceptions;
using Dimok;

namespace Dimok.Menu {

	////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>	Main frame. </summary>
	///
	/// <remarks>	Dimon, 12/21/2010. </remarks>
	////////////////////////////////////////////////////////////////////////////////////////////////////

	public class MainFrame : User.UserPage{

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>	Gets the ltr tabs. </summary>
		///
		/// <value>	The ltr tabs. </value>
		////////////////////////////////////////////////////////////////////////////////////////////////////

		protected Literal ltrTabs { get { return FindControl("ltrTabs") as Literal; } }
		// protected HtmlGenericControl title;
		// protected new object _uox;
		// protected new UserObjectEx uox{get{return (UserObjectEx)_uox;}} 

		protected override object _uox_v{get{return _uox == null ? _uox = new UserObjectEx() : _uox;}}

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>	Gets the uox. </summary>
		///
		/// <value>	The uox. </value>
		////////////////////////////////////////////////////////////////////////////////////////////////////

		protected new UserObjectEx uox{get{ return (UserObjectEx)_uox_v; }}

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>	Raises the load event. </summary>
		///
		/// <remarks>	Dimon, 12/21/2010. </remarks>
		///
		/// <exception cref="ASPException">	Thrown when asp. </exception>
		///
		/// <param name="e">	Event information to send to registered event handlers. </param>
		////////////////////////////////////////////////////////////////////////////////////////////////////

		protected override void OnLoad(EventArgs e) {
			try {
				base.OnLoad(e);
				Response.Cache.SetCacheability(HttpCacheability.NoCache);
				foreach (DataRow row in uox.Pages.Tables[0].Rows)
					ltrTabs.Text += "<COOL:BUTTON onclick=\"tabClick(this,'" + row["PageURL"] + "')\" type=\"check\" group=\"oGroup\" nowrap><div nowrap>" + row["PageDesc"].ToString() + "</div></COOL:BUTTON>\n";
				//if( title != null )title.InnerHtml = uox.ApplInfo.FullName();
			} catch (Exception exc) { throw new ASPException(exc); }
		}

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>	Event handler. Called by Page for load events. </summary>
		///
		/// <remarks>	Dimon, 12/21/2010. </remarks>
		///
		/// <param name="sender">	Source of the event. </param>
		/// <param name="e">			Event information. </param>
		////////////////////////////////////////////////////////////////////////////////////////////////////

		protected virtual void Page_Load(object sender, System.EventArgs e){
		}

	}
}
